package com.wjj.sixinone.common.exception;


import com.wjj.sixinone.common.enums.ExceptionEnum;
import lombok.Data;
import lombok.EqualsAndHashCode;

@EqualsAndHashCode(callSuper = true)
@Data
public class GlobalException extends RuntimeException {
    private Integer status;


    public GlobalException(String message, Integer status) {
        super(message);
        this.status = status;
    }

    public GlobalException(ExceptionEnum exceptionEnum) {
        super(exceptionEnum.getMessage());
        this.status = exceptionEnum.getStatus();
    }
}
